import java.util.HashMap;

/**
 * This class is part of the "World of Advenrture" application. 
 *
 * This class holds an enumeration of all command words known to the game.
 * It is used to recognise commands as they are typed in.
 *
 */
public class CommandWords {
	// a constant array that holds all valid command words
	private static final String[] validCommands = {
		"go", "quit", "exit", "help", "status", "explore", "bas", "item",
	};
	//private HashMap<String, CommandWord> validCommands;

	/**
	 * Check whether a given String is a valid command word. 
	 * @return true if a given string is a valid command,
	 * false if it isn't.
	 */
	public boolean isCommand(String aString)  {
		for(int i = 0; i < validCommands.length; i++) {
			if(validCommands[i].equals(aString))
				return true;
		}
		// if we get here, the string was not found in the commands
		return false;
	}

	public String getCommandList() {
		String ret = this.validCommands[0];
		for (int i=1; i<this.validCommands.length; i++) {
			ret = ret + " " + this.validCommands[i];
		}
		return ret;
	}
}